<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends Controller
{
    public function index()
    {
        $this->display();
    }


    public function login(){

        $adminname = trim(I('post.uer'));
        $password = trim(I('post.pwd'));


        $result = M("admin")-> where(array('adminname'=>$adminname,'password'=>$password)) -> find();

        if($result){
            $this->success('登陆成功',U("index.php/Admin/User/index"));
            session('id', $result['id']);
        }
        else{
            $this->error('登陆失败',U("index.php/Admin/Index/index"));
        }




    }

}